---
title: Code-table caching
summary: Caches PPD and reserve-services reference code tables for the process lifetime.
status: draft
owner: SAIF Documentation Generator
last_reviewed: 2026-08-21
library: SAIF.Business.Claim
reference_type: embedded
operation_id: code-table-caching
trigger: First call to a mdlPPD/mdlReserveServices accessor function, or explicit Refresh argument
---

# Code-table caching

Loads and caches PPD and reserve-services reference code tables in module-level `Static` variables, avoiding repeated database round-trips within a process.

| Field | Value |
| --- | --- |
| **Operation ID** | code-table-caching |
| **Trigger** | First call to an `mdlPPD` or `mdlReserveServices` accessor function, or an explicit `Refresh` argument |
| **Inputs** | Optional `Refresh` boolean |
| **Outputs** | Cached code-table collections |
| **Primary components** | `mdlPPD`, `mdlReserveServices` |
| **Entry point** | SAIF.Business.Claim/mdlPPD.vb |

## Steps

1. Caller invokes an accessor function on `mdlPPD` (e.g., for PPD body parts) or `mdlReserveServices`.
2. If the module-level `Static` cache variable is empty, or `Refresh = True` is supplied, load the code table:
   - PPD body parts ([SQL-026](../sql/SQL-026.md), [CL_PPD_BODY_PART_CODE](../database-tables.md#cl_ppd_body_part_code)).
   - Vocational service types ([SQL-035](../sql/SQL-035.md), [CL_RESERVE_VOC_SERV_TYPE_CODE](../database-tables.md#cl_reserve_voc_serv_type_code)).
3. Otherwise, return the previously cached collection without querying the database.
4. The cache persists for the lifetime of the hosting process; there is no expiry and no synchronization.*

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Accessor function called]) --> Cached{Static cache populated<br>and Refresh = False?}
	Cached -->|Yes| Return([Return cached collection])
	Cached -->|No| Load["Query code table from<br>database"]
	Load --> Store["Store into Static cache<br>variable"]
	Store --> Return
```

## Failure and edge-case behavior
- The cache has no expiry and no synchronization, making it process-lifetime and not thread-safe; concurrent ASP.NET requests share the same cached state.*

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts. Statements marked with `**` could not be confirmed; treat
> as unknown until verified.

## Sources
- SAIF.Business.Claim/mdlPPD.vb
- SAIF.Business.Claim/mdlReserveServices.vb
